<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Test</title>
    <script src="js/jquery-1.12.3.js"/>
    <script type="text/javascript">
        function login() {
            $.ajax({
                type: 'post',
                url: '${pageContext.request.contextPath}/user/login',
                data: '{"id":1}',
                contentType: 'application/json;charset=utf-8',
                success: function (data) {
                    var jsonstr = JSON.stringify(data);
                    alert(jsonstr);
                }, error: function (errorInfo) {
                    alert(errorInfo.toString());
                }
            })
        }
    </script>
</head>
<body>
<H1>TEST Service</H1>

<button onclick="login()"> LOGIN</button>
</body>
</html>